@mermaid-js/mermaid-cli 9.1.2 → 9.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.bundle.js CHANGED
@@ -301,7 +301,7 @@ _asyncToGenerator(function* () {
301
301
  // If it is an output `.md` file, use that to base .svg numbered diagrams on
302
302
  // I.e. if "out.md". use "out-1.svg", "out-2.svg", etc
303
303
 
304
- const outputFile = output.replace(/(\..*)$/, `-${diagrams.length + 1}$1`).replace(/(\.md)$/, '.svg');
304
+ const outputFile = output.replace(/(\.(md|png))$/, `-${diagrams.length + 1}$1`).replace(/(\.md)$/, '.svg');
305
305
  const outputFileRelative = `./${_path.default.relative(_path.default.dirname(_path.default.resolve(output)), _path.default.resolve(outputFile))}`;
306
306
  diagrams.push([outputFile, md]);
307
307
  return `![diagram](${outputFileRelative})`;
@@ -333,4 +333,4 @@ _asyncToGenerator(function* () {
333
333
  }
334
334
 
335
335
  yield browser.close();
336
- })();
336
+ })().catch(exception => error(exception instanceof Error ? exception.stack : exception));